﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.IO;

namespace VCDepend.Console
{
  public class ProgramInfo
  {
    public static string Name
    {
      get
      {
        return "VCDepend";
      }
    }

    public static string Version
    {
      get
      {
        return Assembly.GetExecutingAssembly().GetName().Version.ToString(2);
      }
    }

    public static string Author
    {
      get
      {
        return "Kim Gräsman";
      }
    }

    public static string ReleaseYear
    {
      get
      {
        return "2008";
      }
    }

    public static string UsageInstructions
    {
      get
      {

        StringBuilder target = new StringBuilder();
        AppendHeader(target);

        target.AppendLine("Usage: VCDepend.Console <solution filename> <solution configuration>");
        target.Append(@"Example: VCDepend.Console C:\foo\bar\baz.sln Debug");

        return target.ToString();
      }
    }

    private static void AppendHeader(StringBuilder target)
    {
      const char HeadingSeparatorChar = '=';

      string heading = string.Format("{0} v.{1}, {2} {3}", Name, Version, Author, ReleaseYear);
      string separator = new string(HeadingSeparatorChar, heading.Length);

      target.AppendLine(heading);
      target.AppendLine(separator);
    }
  }
}
